package com.donleo.demo.controller;

import com.donleo.hello.HelloService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author liangd
 * @since 2021-03-03 14:59
 */
@RestController
@RequestMapping("/demo")
public class DemoController {

    @Resource
    private HelloService helloService;

    @GetMapping("/hello")
    public String hello(@RequestParam String name){
        return helloService.sayHello(name);
    }

    @GetMapping("/info")
    public String info(){
        return helloService.helloWorld();
    }
}
